'use strict';

module.exports = app => {
    const { INTEGER, DATE, TEXT } = app.Sequelize;
 
    const TestUser = app.model.define('test_user', {
        test_id: {
            type: INTEGER,
            primaryKey: true,
            allowNull: false,
            autoIncrement: true
        },
        user_id: {
            type: INTEGER,
            primaryKey: true
        },
        // 考生分数
        score: {
            type: INTEGER,
            allowNull: false,
            defaultValue: 0
        },
        // 考生答案
        answers: {
            type: TEXT,
            allowNull: true
        },
        created_at: DATE,
        updated_at: DATE
    });

    return TestUser;
}